express = require 'express'
routes = require './routes'
gzippo = require 'gzippo'
app = module.exports = express.createServer()





#config
app.configure () ->
  app.set 'views', "#{__dirname}/views"
  app.set 'view engine', 'jade'
  app.use express.bodyParser()
  app.use express.methodOverride()
  app.use app.router
  #app.use express.static "#{__dirname}/static"
  app.use gzippo.staticGzip "#{__dirname}/static"

app.configure 'development', () ->
  app.use express.errorHandler {
    dumpException : true
    showStack : true
  }

app.configure 'production', () ->
  app.use express.errorHandler()

app.get '/base', routes.base

app.get '/article/:id', routes.article

app.get '/', routes.index

app.listen 10000
